<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <canvas id="myCanvas" width="1000px" height="1000px"></canvas>
    <script type="text/javascript">
        // 找到canvas元素
        var c = document.getElementById('myCanvas');
        // 创建画笔
        var cvsCtx = c.getContext('2d');

        cvsCtx.fillStyle = 'orange';
        cvsCtx.fillRect(10, 10, 200, 200);

        cvsCtx.moveTo(30, 30);
        cvsCtx.lineTo(70, 70);
        cvsCtx.stroke();

        cvsCtx.beginPath();
        cvsCtx.arc(400, 100, 100, 0, 2*Math.PI);
        cvsCtx.stroke();

        cvsCtx.font="60px Arial";
        cvsCtx.fillText('hello world', 350, 100);
        cvsCtx.strokeText("Hello World",500,50);

        
    </script>
</body>
</html>